C (160/301)

From:Colin Wenzel
Date:26 Aug 99 at 01:51:11
Subject:Re: ExecBase & 'RESET:starting PC' exception

From: Colin Wenzel <colstv@hotkey.net.au>

On 26-Aug-99, Gabriele Svelto wrote:
>From: Gabriele Svelto <jlpicard@tiscalinet.it>
> Hello everybody,
>this question is a little bit on the asm side so I hope I'm not making an
>off topic...
>I read in the RKRM that ExecBase is the only part of the OS which is at an
>absolute address in memory ($00000004). Well since I took a look at some
>asm tutorials (as I'm interested in putting in asm some routines which are
>reaaally time crictical...) and found that the location $4 contained the
>pointer to the 'RESET: starting PC' exception.

OK, here's how it works. After the cpu comes out of reset,
it is in supervisor mode, with the hardware set to map the rom from
address 0, it fetches the supervisor's stack address from location $0,
& the initial PC (program counter) value from address $4,
it then jumps to that location.

Shortly after that, the hardware is switched, to relocate the rom up
to the normal $f80000 area, then the low memory area is mapped as ram.

The exception tables are generally located in this area, but they can be
moved elsewhere if necessary....

The OS just happens to put a pointer to execbase at address $4 too...

----------------------------------------------------
Colin Wenzel. Queensland, Australia.
EMAIL: colstv@hotkey.net.au
URL: http://www.hotkey.net.au/~colstv/

'AMIGA' 4000T With CS-III 68060 / 50Mhz 150Mb RAM.
----------------------------------------------------